package com.demo.List.ArrayList.pokerCard;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @Author :蕉绿
 * @Date : 2023/2/4 9:42
 * @Version : V1.0
 * @Description :
 */
public class Test {
    public static void main(String[] args) {
        CardDemo cardDemo = new CardDemo();
        List<Card> list = cardDemo.buyCards();
        System.out.println(list);
        System.out.println("洗牌:");
        cardDemo.shuffle(list);
        System.out.println(list);
        ArrayList<Card> play1 = new ArrayList<>();
        ArrayList<Card> play2 = new ArrayList<>();
        ArrayList<Card> play3 = new ArrayList<>();


        for (int i = 0; i < 9; i++) {
            if(i % 3 == 0) {
                play1.add(list.get(0));
                list.remove(0);
            } else if(i % 3 == 1) {
                play2.add(list.get(0));
                list.remove(0);
            } else {
                play3.add(list.get(0));
                list.remove(0);
            }
        }
        System.out.println(play1);
        System.out.println(play2);
        System.out.println(play3);
        System.out.println(list);








    }
}
